/**
 * Created by zhaott on 2018/9/21.
 */
var gulp = require("gulp");
var ts = require("gulp-typescript");
var tsProject = ts.createProject("tsconfig.json");

gulp.task('default',['test']);//,'copy-html'

gulp.task("compile", function () {
    return tsProject.src()
        .pipe(tsProject())
        .js.pipe(gulp.dest("dist"));
});

gulp.task('compile02', function () {
    return gulp.src('src/**02**/*.ts')
        .pipe(tsProject())
        .pipe(gulp.dest('dist'));
});

var paths = {
    pages: ['src/**02**/*.html']
};
gulp.task("copy-html", function () {
    return gulp.src(paths.pages)
        .pipe(gulp.dest("dist"));
});

const shell = require('gulp-shell');
// gulp.task('test',['compile'], function () {
//     return gulp.src(['dist/**.js',"!**/*html*/*.js"], {read: false})
//         .pipe(shell([
//             'node <%= file.path %>'
//         ]))
// });
gulp.task('test',['compile02'], function () {
    return gulp.src(['dist/**/**.js',"!**/*html*/*.js"], {read: false})
        .pipe(shell([
            'node <%= file.path %>'
        ]))
});
